# _*_ coding: UTF-8 _*_
# @Time     : 2021/11/4 11:24
# @Author   : Gong Yangyi
# @Site     : http://www.hzdledu.cn/
# @File     : 城市列表.py
# @Software : PyCharm

from selenium import webdriver
import time
import unittest


class Test1(unittest.TestCase):

    def setUp(self) -> None:
        self.driver = webdriver.Chrome()
        self.driver.maximize_window()

        self.driver.get('http://192.168.6.66/cloud/#/open/login')

        self.driver.find_element_by_xpath('//*[@id="account"]/input').send_keys('admin')
        self.driver.find_element_by_xpath('//*[@id="password"]/input').send_keys('123456')
        self.driver.find_element_by_xpath('//*[@id="authCode"]/div/input').send_keys('8888')
        self.driver.find_element_by_xpath('//*[@id="root"]/div/div[1]/form/div[5]/div/div/span/button').click()

    def test1(self):

        time.sleep(2)
        self.driver.find_element_by_class_name('ant-menu-submenu-title').click()
        # ActionChains(driver).click(driver.find_element_by_xpath('//*[@id="root"]/section/aside/div/ul/li[4]/div/span/i')).perform()#点击系统管理
        time.sleep(1)
        self.driver.find_element_by_xpath('//*[@id="sys$Menu"]/li[4]/a').click() # 点击城市列表
        time.sleep(1)
        self.driver.find_element_by_xpath('//*[@id="root"]/section/section/main/div/div[1]/button[1]').click() # 点击添加按键
        time.sleep(1)